<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>在线还款</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="../../../js/angular.js"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="../../../layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="../../../dwwsyyt/dw/gjjhbj/fy.js"></script>
</head>
<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 30px;">
		<legend>在线还款</legend>
	</fieldset>
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	  <div ng-hide="qaqdiv">
		<table class="layui-table" style="width:90%">
			<tr align="center" style="background-color:#f1f1f1">
			    <td ng-hide="true">ID</td>
				<td>操作</td>
				<td>借款人姓名</td>
				<td>应还日期</td>
				<td>还款金额</td>
				<td>还款本金</td>
				<td>还款利息</td>
				<td>罚息</td>
				<td>违约金</td>
				<td>实际还款金额</td>
			</tr>
			<tr ng-repeat="x in names" align="center">
			   <td ng-if="$odd" style="background-color:#f1f1f1"ng-show="false">{{$index}}</td>
			   <td ng-if="$even"ng-show="false">{{$index}}</td>
			   <td ng-if="$odd" style="background-color:#f1f1f1" ng-hide="true">{{x.ID}}</td>
			   <td ng-if="$even" ng-hide="true">{{x.ID}}</td>
			   <td ng-if="$odd" style="background-color:#f1f1f1"ng-click="zxhk($index)"><button type="button">在线还款</button></td>
			   <td ng-if="$even" ng-click="zxhk($index)"><button type="button">在线还款</button></td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.JKRXM }}</td>
				<td ng-if="$even">{{ x.JKRXM }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.YHRQ }}</td>
				<td ng-if="$even">{{ x.YHRQ }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.HKJE }}</td>
				<td ng-if="$even">{{ x.HKJE }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.HKBJ }}</td>
				<td ng-if="$even">{{ x.HKBJ }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.HKLX }}</td>
				<td ng-if="$even">{{ x.HKLX }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.FX }}</td>
				<td ng-if="$even">{{ x.FX }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.WYJ }}</td>
				<td ng-if="$even">{{ x.WYJ }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.HKJE }}</td>
				<td ng-if="$even">{{ x.HKJE }}</td>
				<td ng-if="$odd" ng-hide="true" style="background-color:#f1f1f1">{{ x.HKJHLSH }}</td>
				<td ng-if="$even" ng-hide="true">{{ x.HKJHLSH }}</td>	
				<td ng-if="$odd" ng-hide="true" style="background-color:#f1f1f1">{{ x.DKZH }}</td>
				<td ng-if="$even" ng-hide="true">{{ x.DKZH }}</td>	
				<td ng-if="$odd" ng-hide="true" style="background-color:#f1f1f1">{{ x.GSDQDM }}</td>
				<td ng-if="$even" ng-hide="true">{{ x.GSDQDM }}</td>	
				<td ng-if="$odd" ng-hide="true" style="background-color:#f1f1f1">{{ x.DQDM }}</td>
				<td ng-if="$even" ng-hide="true">{{ x.DQDM }}</td>	
			</tr>
		</table>
		<div class="layui-btn-group">
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Sy()">首页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Previous()">上一页</button>
			<button ng-repeat="page in pageList"
				class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="selectPage(page)">{{ page }}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Next()">下一页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Wy()">尾页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm ">{{selPage}}/{{pages}}</button>
		  </div>
		</div>
	</div>
	<script>
		layui.use('element', function() {
			var $ = layui.jquery, element = layui.element;
		});
	</script>
	<script type="text/javascript">
	
	function getPath() {  
	     
	        return 'http://'+location.host;
	}
		
		
	</script>
	<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../../../layui/layer.ext.js"></script>
	<script type="text/javascript">
		var a;
       var app = angular.module('myApp', []);
		    app.controller('customersCtrl', function($scope, $http) {
		    $scope.zxhkdiv=true;
			$http({
				url:getPath() + "/wsyyt/zxhkcontroller/test",
				method:'post',
			}).then(
					function(res) {
								$scope.data = res.data.data;//自己打断点看格式:[{},{}]
								if(res.data.code==1){
									layer.msg('提示：'+res.data.CW,{icon: 5});
								}		
								a = res.data.CNT;
								feny($scope.data);
			});
	$scope.zxhk=function(index){
	 $scope.params = {
		id : $scope.data[index].ID,
		yhrq:$scope.data[index].YHRQ,
		hkje:$scope.data[index].HKJE,
		hkbj:$scope.data[index].HKBJ,
	    fx:$scope.data[index].FX,
		sjhkje:$scope.data[index].SJHKJE,
		dqdm:$scope.data[index].DQDM,
		gsdqdm:$scope.data[index].GSDQDM,
		hkjhlsh:$scope.data[index].HKJHLSH,
		DQDM:$scope.data[index].DQDM,
		GSDQDM:$scope.data[index].GSDQDM,
		DKZH:$scope.data[index].DKZH,
	 };
	 $http({
	   url:getPath() + "/wsyyt/zxhkcontroller/test1",
	   method:'post',
	   params:$scope.params
	 }).then(function(res) {
		if(res.data.code==0){
		  layer.msg('提示：还款已受理、请等待审核',{icon: 5});
		}else{
		  layer.msg('提示：'+res.data.CW,{icon: 5});
			}
		});
	};	
});	
</script>
</body>
</html>